package com.bwie.response;


public class ResponseUtil {

    public static final int CODE_SUCCESS = 200;

    public static final int CODE_FAIL = 500;

    public static final int AUTH_FAILED = 505;

    public static <T> BaseResponse<T> success(String message, T t) {
        return new BaseResponse(CODE_SUCCESS, message, t);
    }

    public static <T> BaseResponse<T> success(String message) {
        return new BaseResponse(CODE_SUCCESS, message, null);
    }

    public static <T> BaseResponse<T> error(String message) {
        return new BaseResponse(CODE_FAIL, message, null);
    }

    public static <T> BaseResponse<T> authFailed(String message) {
        return new BaseResponse(AUTH_FAILED, message, null);
    }

    public static <T> BaseResponse<T> errorParam() {
        return error("参数不完整");
    }

}
